package client;
import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;

/**
 * 
 * @author KaHvEcI
 *
 * @param <E>
 */


public class ClientRMI<E> {
	
	private String ipServeur;
	private String nomServeur;
	private E stub;
		
	public ClientRMI(String ip, String nom){
		
		ipServeur=ip;
		nomServeur=nom;
		stub=null;
			
	}
	

	@SuppressWarnings("unchecked")
	public void connect() throws MalformedURLException, RemoteException, NotBoundException{
		
		stub = (E) Naming.lookup("rmi://"+ipServeur+"/"+nomServeur);

	}
	
	public E getStub(){
		
		return stub;
	}
	
}

